count = 0
for i in [1,2,3,4]:
    for j in [1,2,3,4]:
        for k in [1,2,3,4]:
            if i!=j and i!=k and j!=k:
                print(f"{i}{j}{k}",end="    ")
                count += 1
print("一共可以组成",count,"不相同的数字")


